package sessions;

import java.util.List;

import javax.ejb.Remote;

import entities.FriendshipRequest;
import entities.User;
import exceptions.FriendshipRequestException;

@Remote
public interface FriendshipManagerRemote {

	/**
	 * @param fromUser
	 *            User entity
	 * @param toUser
	 *            User entity
	 * @param message
	 *            attached text
	 * @throws FriendshipRequestException
	 */
	public void request(User fromUser, User toUser, String message)
			throws FriendshipRequestException;

	/**
	 * @param username
	 *            User entity
	 * @return the list of incoming requests
	 */
	public List<FriendshipRequest> fetchIncoming(String username);

	/**
	 * @param username
	 *            User entity
	 * @return the list of outgoing requests
	 */
	public List<FriendshipRequest> fetchOutgoing(String username);

	/**
	 * @param id
	 * @return
	 */
	public FriendshipRequest fetch(int id);

	/**
	 * @param fr
	 *            FriendshipReqest to change status
	 */
	public void accept(FriendshipRequest fr);

	/**
	 * @param fr
	 *            FriendshipRequest to change status
	 */
	public void refuse(FriendshipRequest fr);

	/**
	 * @param username
	 *            User entity
	 * @return the list of friends
	 */
	public List<User> fetchFriends(String username);

}
